//
//  FQDRegularFeedCellItem.m
//  FakeQDaily
//
//  Created by mewxiv on 10/7/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import "FQDRegularFeedCellItem.h"
#import "FQDArticleFeedCellItem.h"
#import "FQDLabFeedCellItem.h"
#import "FQDFeed.h"

@implementation FQDRegularFeedCellItem

+ (instancetype)cellItemWithRestModel:(id)restModel
{
    FQDRegularFeedCellItem *cellItem = nil;
    if ([restModel isKindOfClass:[FQDFeed class]]) {
        FQDFeed *feed = (FQDFeed *)restModel;
        if (feed.type == FQDFeedTypeLab) {
            cellItem = [[FQDLabFeedCellItem alloc] init];
        } else {
            cellItem = [[FQDArticleFeedCellItem alloc] init];
        }
        cellItem.restModel = feed;
    }
    return cellItem;
}

- (void)setRestModel:(id)restModel
{
    [super setRestModel:restModel];
    self.feed = restModel;
}

@end
